package wangjg.android.wifiadmin;

public class ClickCounter {
	private static final int delay = 1000;
	private int _num;
	
	private long time = 0;
	private int clicknum = 0;
	
	public boolean click(){
		long curTime = System.currentTimeMillis();
		if(time + delay < curTime){
			clicknum = 0;
		}
		
		time = curTime;
		
		clicknum++;
		
		return clicknum >=_num;
	}

	public ClickCounter(int num) {
		this._num = num;
	}
	
}
